<template>
<!-- 新建档案 -->
   <div>
        <el-row>
           <el-col :span="24">
                <div class="grid-content bg-purple-dark">
                    <div class="kuang"></div>
                    <span style=" padding-left:40px;font-size:15px;">职位信息</span>
                    <div class="xian"></div>
                    <el-form :inline="true" label-width="180px" :model="formInline" class="demo-form-inline" style="padding-top:30px;">
                       <el-form-item label="招聘职位">
                            <el-select v-model="formInline.positionId" placeholder="请选择" style="width:350px;">
                            <el-option
                                v-for="item in options"
                                :key="item.id"
                                :label="item.tposition.positionName"
                                :value="item.id">
                            </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="添加流程">
                            <el-select v-model="formInline.status" placeholder="添加流程" style="width:350px;">
                            <el-option label="初筛" value="1"></el-option>
                            <el-option label="待面试" value="2"></el-option>
                            <el-option label="面试中" value="3"></el-option>
                            <el-option label="面试通过" value="4"></el-option>
                            <el-option label="已发offer" value="5"></el-option>
                            <el-option label="待入职" value="6"></el-option>
                            <el-option label="人才库" value="7"></el-option>
                            </el-select>
                        </el-form-item>
                        
                        <br/>
                         
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;font-size:15px;">候选人信息</span>
                        <div class="xian"></div>
                        <br/><br/>
                        <el-form-item label="姓名">
                            <el-input v-model="formInline.candidateName" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="性别">
                            <el-select v-model="formInline.sex" placeholder="性别" style="width:350px;">
                            <el-option label="男" value="1"></el-option>
                            <el-option label="女" value="2"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="年龄">
                            <el-input v-model="formInline.age" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="手机号">
                            <el-input v-model="formInline.phone" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="学历">
                            <el-select v-model="formInline.education" placeholder="添加流程" style="width:350px;">
                            <el-option label="高中及以下" value="1"></el-option>
                            <el-option label="大专" value="2"></el-option>
                            <el-option label="本科" value="3"></el-option>
                            <el-option label="硕士" value="4"></el-option>
                            <el-option label="博士及以上" value="5"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="出生日期">
                             <el-date-picker
                                style="width:350px;"
                                value-format="yyyy-MM-dd"
                                v-model="formInline.birthday"
                                type="date"
                                placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item label="邮箱">
                            <el-input v-model="formInline.email" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="婚姻状况">
                            <el-select v-model="formInline.maritalStatus" placeholder="添加流程" style="width:350px;">
                            <el-option label="未婚" value="1"></el-option>
                            <el-option label="已婚" value="2"></el-option>
                            <el-option label="离异" value="3"></el-option>
                            <el-option label="丧偶" value="4"></el-option>
                            </el-select>
                         </el-form-item>
                        <el-form-item label="专业">
                            <el-input v-model="formInline.major" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="毕业学校">
                            <el-input v-model="formInline.school" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="工作经验">
                            <el-select v-model="formInline.workExperience" placeholder="添加流程" style="width:350px;">
                            <el-option label="3年以上" value="1"></el-option>
                            <el-option label="5年以上" value="2"></el-option>
                            <el-option label="8年以上" value="3"></el-option>
                            <el-option label="10年以上" value="4"></el-option>
                            </el-select>
                         </el-form-item>
                        <el-form-item label="参加工作时间">
                             <el-date-picker
                                style="width:350px;"
                                value-format="yyyy-MM-dd"
                                v-model="formInline.workDate"
                                type="date"
                                placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item label="上一家离职公司">
                            <el-input v-model="formInline.company" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="个人优势">
                            <el-input type="textarea" v-model="formInline.advantage" :rows="4" style="width:350px;"></el-input>
                        </el-form-item>
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;font-size:15px;">求职意向</span>
                        <div class="xian"></div>
                        <br/><br/>
                        <el-form-item label="期望薪资">
                            <el-input v-model="formInline.salaryExpectation" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="工作地点">
                            <el-input v-model="formInline.address" placeholder="请输入" style="width:350px;"></el-input>
                        </el-form-item>
                        <el-form-item label="工作性质">
                            <el-select v-model="formInline.postType" placeholder="所属案卷" style="width:350px;">
                            <el-option label="全职" value="0"></el-option>
                            <el-option label="兼职" value="1"></el-option>
                            <el-option label="实习" value="2"></el-option>
                            <el-option label="外派" value="3"></el-option>
                            <el-option label="退休返聘" value="4"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="到岗期限">
                            <el-select v-model="formInline.arrivalDate" placeholder="所属案卷" style="width:350px;">
                            <el-option label="随时到岗" value="1"></el-option>
                            <el-option label="一周内" value="2"></el-option>
                            <el-option label="两周内" value="3"></el-option>
                            <el-option label="一个月内" value="4"></el-option>
                            </el-select>
                        </el-form-item>
                        <br/><br/><br/>
                        <el-form-item style="padding-left:920px;">
                            <el-button >取消</el-button>
                            <el-button type="primary" @click="onSubmit">提交</el-button>
                        </el-form-item>
                    </el-form>
                </div>
            </el-col>
        </el-row>
   </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            formInline: {
               positionId:"",
               status:"",
               candidateName:"",
               sex:"",
               age:"",
               phone:"",
               education:"",
               birthday:"",
               email:"",
               maritalStatus:"",
               major:"",
               school:"",
               workDate:"",
               company:"",
               advantage:"",
               salaryExpectation:"",
               address:"",
               postType:"",
               arrivalDate:"",
               workExperience:""
            },
            options: [],
        }
    },
    created(){
     this.getPMessage();
    },
    methods: {
         getPMessage(){
             axios.post("TPositionMessage/findPMessageAll")
                .then((res) => {
                    console.log(res);
                    this.options = res.data;
                })
         },
         onSubmit(){
             axios
            .post("TCandidate/addCandidate", this.formInline)
            .then((res) => {
                if (res.data.code == 200) {
                this.$message({
                    message: "恭喜你，" + res.data.msg,
                    type: "success",
                    
                });
                this.resetQuery();
                this.$router.push("/Candidate")
                } else {
                this.$message.error("错了哦，" + res.data.msg);
                }
            });
         },
         resetQuery(){
            this.formInline.positionId="";
            this.formInline.status="";
            this.formInline.candidateName="";
            this.formInline.sex="";
            this.formInline.age="";
            this.formInline.phone="";
            this.formInline.education="";
            this.formInline.birthday="";
            this.formInline.email="";
            this.formInline.maritalStatus="";
            this.formInline.major="";
            this.formInline.school="";
            this.formInline.workDate="";
            this.formInline.company="";
            this.formInline.advantage="";
            this.formInline.salaryExpectation="";
            this.formInline.address="";
            this.formInline.postType="";
            this.formInline.arrivalDate="";
         }
       
    }

}
</script>

<style scoped>
.el-row {
    margin-bottom: 20px;
  }
  .el-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: white;
    height: 1100px;
  }
  .bg-purple {
    background: #d3dce6;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
  .kuang {
    width: 4.5px;
    height: 25px;
    background-color: #409EFF;
    margin-left: 30px;
    position: relative;
    top: 23px;
}

.xian {
    width: 1200px;
    height: 2px;
    background-color: #EBEEF5;
    margin-left: 40px;
    margin-top: 15px;

}
 /* 获取负责人start */
    .architecture{
        width: 271px;
        height: 39px;
        padding-left: 20px;
        border-radius: 5px;
    }
    .architecture:hover{
        background-color: #f8f8f8;
    }
    .architectureActe{
        width: 271px;
        height: 39px;
        line-height: 39px;
        padding-left: 20px;
        border-radius: 5px;
        background-color: rgba(231, 244, 255, 1);;
    }
    /* 竖着的水平线 */
    .myHr{
        border-left: 2px solid#989DAA;;
        height:100%;
        left: 48%;
        top: 0px;
        position: absolute;
    }

    .log{
        width: 27px;
        height: 27px;
        background-color: rgba(158, 208, 255, 1);
        float: left;
        position: relative;
        top: 15%;
        border-radius: 50%;
    }
    .log img{
        width: 13px;
        height: 13px;
        position: relative;
        bottom: 15%;
        left: 25%;
    }
    .avatar-uploader-icon[data-v-3719bc3e]{
        border: 1px solid rgba(198, 201, 208, 1);
        background-color: rgba(248, 248, 248, 1);
        border-radius: 50%;
    }
    .avatar-uploader-icon {
        font-size: 20px;
        color: #8c939d;
        width: 50px;
        height: 50px;
        line-height: 50px;
        text-align: center;
    }
    /* 获取负责人end */
</style>